package main

func main() {
	minDeletionSize([]string{"cca", "dbf", "gai"})
}

func minDeletionSize(A []string) int {
	row := make(map[int]int)
	for i := 0; i < len(A)-1; i++ {
		for j := 0; j < len(A[i]); j++ {
			if A[i][j] > A[i+1][j] {
				row[j] = 0
			}
		}
	}
	return len(row)
}
